home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / lmcons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  8.3 KB  |  281 lines

  1. /*++ BUILD Version: 0003    // Increment this if a change has global effects
  2.  
  3. Module Name:
  4.  
  5.     LMCONS.H (was NETCONS.H in LM 2.x)
  6.  
  7. Abstract:
  8.  
  9.     This file contains constants used throughout the LAN Manager
  10.     API header files.  It should be included in any source file
  11.     that is going to include other LAN Manager API header files or
  12.     call a LAN Manager API.
  13.  
  14.     NOTE:  Lengths of strings are given as the maximum lengths of the
  15.     string in characters (not bytes).  This does not include space for the
  16.     terminating 0-characters.  When allocating space for such an item,
  17.     use the form:
  18.  
  19.         TCHAR username[UNLEN+1];
  20.  
  21.     Definitions of the form LN20_* define those values in effect for
  22.     LanMan 2.0.
  23.  
  24.  
  25. Author:
  26.  
  27.     unknown
  28.  
  29. Revision History:
  30.  
  31.     25-Jan-1991     Danl
  32.         Added NET_API_STATUS and NET_API_FUNCTION
  33.     04-Feb-1991     JohnRo
  34.         Avoid conflicts with <windef.h> (defines IN, OUT, but not OPTIONAL).
  35.     26-Feb-1991     JohnRo
  36.         Added PARM_ERROR_UNKNOWN and PARM_ERROR_NONE.
  37.     09-May-1991     JohnRo
  38.         Make PARM_ERROR_UNKNOWN a legal DWORD.  Got rid of tabs, to keep ChuckL
  39.         happy.  Change NULL to ((void *)0) for portability.  Make sure all
  40.         includes and defines start in column 1, to avoid MIPS problems.
  41.         Changed to use slash-slash comments.
  42.     20-May-1991     CliffV
  43.         Removed several unused definitions.  Changed limits to be windows
  44.         and NT compatible.  Added LM20_* definitions.
  45.     18-Jul-1991 RFirth
  46.         Added PARMNUM_BASE_INFOLEVEL
  47.     30-Jul-1991 DanHi
  48.         Changed definitions of *_FILENAME to NT values and deleted *_FILE
  49.     04-Apr-1992 JohnRo
  50.         Added MAX_PREFERRED_LENGTH.
  51.  
  52. --*/
  53.  
  54. /*
  55.  *      C/C++ Run Time Library - Version 9.0
  56.  *
  57.  *      Copyright (c) 1994, 1998 by Borland International
  58.  *      All Rights Reserved.
  59.  *
  60.  */
  61.  
  62. /*NOINC*/
  63. #ifndef NETCONS_INCLUDED
  64. #define NETCONS_INCLUDED
  65. #define __LMCONS_H
  66. #pragma option push -b
  67.  
  68.  
  69. /*INC*/
  70.  
  71. #ifndef PASCAL
  72. #define PASCAL                          // pascal on OS/2
  73. #endif
  74.  
  75. #ifndef FAR
  76. #define FAR                             // far on OS/2
  77. #endif
  78.  
  79. //
  80. // String Lengths for various LanMan names
  81. //
  82.  
  83. #define CNLEN       15                  // Computer name length
  84. #define LM20_CNLEN  15                  // LM 2.0 Computer name length
  85. #define DNLEN       CNLEN               // Maximum domain name length
  86. #define LM20_DNLEN  LM20_CNLEN          // LM 2.0 Maximum domain name length
  87.  
  88. #if (CNLEN != DNLEN)
  89. #error CNLEN and DNLEN are not equal
  90. #endif
  91.  
  92. #define UNCLEN      (CNLEN+2)           // UNC computer name length
  93. #define LM20_UNCLEN (LM20_CNLEN+2)      // LM 2.0 UNC computer name length
  94.  
  95. #define NNLEN       80                  // Net name length (share name)
  96. #define LM20_NNLEN  12                  // LM 2.0 Net name length
  97.  
  98. #define RMLEN       (UNCLEN+1+NNLEN)    // Max remote name length
  99. #define LM20_RMLEN  (LM20_UNCLEN+1+LM20_NNLEN) // LM 2.0 Max remote name length
  100.  
  101. #define SNLEN       80                  // Service name length
  102. #define LM20_SNLEN  15                  // LM 2.0 Service name length
  103. #define STXTLEN     256                 // Service text length
  104. #define LM20_STXTLEN 63                 // LM 2.0 Service text length
  105.  
  106. #define PATHLEN     256                 // Max. path (not including drive name)
  107. #define LM20_PATHLEN 256                // LM 2.0 Max. path
  108.  
  109. #define DEVLEN      80                  // Device name length
  110. #define LM20_DEVLEN 8                   // LM 2.0 Device name length
  111.  
  112. #define EVLEN       16                  // Event name length
  113.  
  114. //
  115. // User, Group and Password lengths
  116. //
  117.  
  118. #define UNLEN       256                 // Maximum user name length
  119. #define LM20_UNLEN  20                  // LM 2.0 Maximum user name length
  120.  
  121. #define GNLEN       UNLEN               // Group name
  122. #define LM20_GNLEN  LM20_UNLEN          // LM 2.0 Group name
  123.  
  124. #define PWLEN       256                 // Maximum password length
  125. #define LM20_PWLEN  14                  // LM 2.0 Maximum password length
  126.  
  127. #define SHPWLEN     8                   // Share password length (bytes)
  128.  
  129.  
  130. #define CLTYPE_LEN  12                  // Length of client type string
  131.  
  132.  
  133. #define MAXCOMMENTSZ 256                // Multipurpose comment length
  134. #define LM20_MAXCOMMENTSZ 48            // LM 2.0 Multipurpose comment length
  135.  
  136. #define QNLEN       NNLEN               // Queue name maximum length
  137. #define LM20_QNLEN  LM20_NNLEN          // LM 2.0 Queue name maximum length
  138. #if (QNLEN != NNLEN)
  139. # error QNLEN and NNLEN are not equal
  140. #endif
  141.  
  142. //
  143. // The ALERTSZ and MAXDEVENTRIES defines have not yet been NT'ized.
  144. // Whoever ports these components should change these values appropriately.
  145. //
  146.  
  147. #define ALERTSZ     128                 // size of alert string in server
  148. #define MAXDEVENTRIES (sizeof (int)*8)  // Max number of device entries
  149.  
  150.                                         //
  151.                                         // We use int bitmap to represent
  152.                                         //
  153.  
  154. #define NETBIOS_NAME_LEN  16            // NetBIOS net name (bytes)
  155.  
  156. //
  157. // Value to be used with APIs which have a "preferred maximum length"
  158. // parameter.  This value indicates that the API should just allocate
  159. // "as much as it takes."
  160. //
  161.  
  162. #define MAX_PREFERRED_LENGTH    ((DWORD) -1)
  163.  
  164. //
  165. //        Constants used with encryption
  166. //
  167.  
  168. #define CRYPT_KEY_LEN           7
  169. #define CRYPT_TXT_LEN           8
  170. #define ENCRYPTED_PWLEN         16
  171. #define SESSION_PWLEN           24
  172. #define SESSION_CRYPT_KLEN      21
  173.  
  174. //
  175. //  Value to be used with SetInfo calls to allow setting of all
  176. //  settable parameters (parmnum zero option)
  177. //
  178. #ifndef PARMNUM_ALL
  179. #define PARMNUM_ALL             0
  180. #endif
  181.  
  182. #define PARM_ERROR_UNKNOWN      ( (DWORD) (-1) )
  183. #define PARM_ERROR_NONE         0
  184. #define PARMNUM_BASE_INFOLEVEL  1000
  185.  
  186. //
  187. //        Message File Names
  188. //
  189.  
  190. #define MESSAGE_FILENAME        TEXT("NETMSG")
  191. #define OS2MSG_FILENAME         TEXT("BASE")
  192. #define HELP_MSG_FILENAME       TEXT("NETH")
  193.  
  194. /**INTERNAL_ONLY**/
  195.  
  196. // The backup message file named here is a duplicate of net.msg. It
  197. // is not shipped with the product, but is used at buildtime to
  198. // msgbind certain messages to netapi.dll and some of the services.
  199. // This allows for OEMs to modify the message text in net.msg and
  200. // have those changes show up.        Only in case there is an error in
  201. // retrieving the messages from net.msg do we then get the bound
  202. // messages out of bak.msg (really out of the message segment).
  203.  
  204. #define BACKUP_MSG_FILENAME     TEXT("BAK.MSG")
  205.  
  206. /**END_INTERNAL**/
  207.  
  208. #ifndef NULL
  209. #    if defined(__cplusplus)
  210. #      define NULL 0
  211. #    else
  212. #      define NULL ((void *)0)
  213. #    endif
  214. #endif
  215.  
  216. //
  217. // Keywords used in Function Prototypes
  218. //
  219.  
  220. #define NET_API_STATUS          DWORD
  221. #define API_RET_TYPE            NET_API_STATUS      // Old value: do not use
  222. #if (_MSC_VER >= 800) || defined (_STDCALL_SUPPORTED) || defined(__BORLANDC__)
  223. #define NET_API_FUNCTION    __stdcall
  224. #else
  225. #define NET_API_FUNCTION
  226. #endif
  227.  
  228. // Define pseudo-keywords.
  229. #ifndef IN
  230. #define IN
  231. #endif
  232.  
  233. #ifndef OPTIONAL
  234. #define OPTIONAL
  235. #endif
  236.  
  237. #ifndef OUT
  238. #define OUT
  239. #endif
  240. /*INC*/
  241.  
  242.  
  243.  
  244. //
  245. // The platform ID indicates the levels to use for platform-specific
  246. // information.
  247. //
  248.  
  249. #define PLATFORM_ID_DOS 300
  250. #define PLATFORM_ID_OS2 400
  251. #define PLATFORM_ID_NT  500
  252. #define PLATFORM_ID_OSF 600
  253. #define PLATFORM_ID_VMS 700
  254.  
  255. //
  256. //      There message numbers assigned to different LANMAN components
  257. //      are as defined below.
  258. //
  259. //      lmerr.h:        2100 - 2999     NERR_BASE
  260. //      alertmsg.h:     3000 - 3049     ALERT_BASE
  261. //      lmsvc.h:        3050 - 3099     SERVICE_BASE
  262. //      lmerrlog.h:     3100 - 3299     ERRLOG_BASE
  263. //      msgtext.h:      3300 - 3499     MTXT_BASE
  264. //      apperr.h:       3500 - 3999     APPERR_BASE
  265. //      apperrfs.h:     4000 - 4299     APPERRFS_BASE
  266. //      apperr2.h:      4300 - 5299     APPERR2_BASE
  267. //      ncberr.h:       5300 - 5499     NRCERR_BASE
  268. //      alertmsg.h:     5500 - 5599     ALERT2_BASE
  269. //      lmsvc.h:        5600 - 5699     SERVICE2_BASE
  270. //      lmerrlog.h      5700 - 5799     ERRLOG2_BASE
  271. //
  272.  
  273. #define MIN_LANMAN_MESSAGE_ID  NERR_BASE
  274. #define MAX_LANMAN_MESSAGE_ID  5799
  275.  
  276. /*NOINC*/
  277.  
  278. #pragma option pop
  279. #endif // NETCONS_INCLUDED
  280. /*INC*/
  281.